#ifndef __EnergyFlowManage_H__
#define __EnergyFlowManage_H__

#include "..\..\DuiLib\UIlib.h"

struct EnergyFlowChangedParam
{
	CDuiString progress;
	enum SHOWING_TIME {
		SHOWING_TIME_START = 0,
		SHOWING_TIME_END,
		SHOWING_TIME_CHAINSTART,
		SHOWING_TIME_CHAINEND
	} showtime;
};

typedef class ObserverImpl<BOOL, EnergyFlowChangedParam> EnergyFlowChangedObserver;
typedef class ReceiverImpl<BOOL, EnergyFlowChangedParam> EnergyFlowChangedReceiver;

class EnergyFlowManage {
public:
	static EnergyFlowManage* GetEnergyFlowManager()
	{
		if (m_Manager == NULL) {
			m_Manager = new EnergyFlowManage();
		}		 

		return m_Manager;
	}
	//enum ENERGY_CIRCULATION_STATUS {
	//	ENERGY_CIRCULATION_COLD_BASE_STORAGE = 0,
	//	ENERGY_CIRCULATION_SOLAR_TOWER_CONCENTRATE_HEAT,
	//	ENERGY_CIRCULATION_HOT_BASE_STORAGE,
	//	ENERGY_CIRCULATION_STEAMGEN_ENHEAT,
	//	ENERGY_CIRCULATION_STEAMDYNAMO_ELECTRICITY,
	//	ENERGY_CIRCULATION_CONDENSER,
	//	ENERGY_CIRCULATION_ELECTRICITY_AC_NET,

	//	ENERGY_CIRCULATION_STATUS_NUM
	//};

public:
	//void SetEnergyStatus(ENERGY_CIRCULATION_STATUS enStatus) {
	//	m_enEnergyStatus = enStatus;
	//}
	//ENERGY_CIRCULATION_STATUS SetEnergyStatus() {
	//	return m_enEnergyStatus;
	//}
	void AddReceiver(ReceiverImpl<BOOL, EnergyFlowChangedParam>* receiver)
	{
		m_ChangeObserver.AddReceiver(receiver);
	}

	void RemoveReceiver(ReceiverImpl<BOOL, EnergyFlowChangedParam>* receiver)
	{
		m_ChangeObserver.RemoveReceiver(receiver);
	}

	void Broadcast(EnergyFlowChangedParam param)
	{
		m_ChangeObserver.Broadcast(param);
	}

	void Notify(EnergyFlowChangedParam param)
	{
		m_ChangeObserver.Notify(param);
	}

private:
	EnergyFlowManage()
		//:m_enEnergyStatus(ENERGY_CIRCULATION_STATUS_NUM) 
	{
		//AddReceiver(this);
	}

private:
	//ENERGY_CIRCULATION_STATUS m_enEnergyStatus;

	EnergyFlowChangedObserver m_ChangeObserver;
	static EnergyFlowManage *m_Manager;
};


#endif